<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.11.2.min.js"></script>
    <script src="calendar.js"></script>
    <link rel="stylesheet" href="calendar.css">
</head>
<body>
   <div>
       <input type="text" id="txtYm" name="YM" />
    <div id="calendar" class="calendar"></div>
       <button id="btnGetDays">获取选中日期</button>
   </div>
    <script>
        $(function(){
            $("#btnGetDays").on("click", function(){
                alert($("#calendar").getDays()) ;
            });
            $("#txtYm").on("change",function(){
                // $("#calendar").calendar({year:2016,month:2,selectedDays:'1,4,7'});
                var d = new Date($("#txtYm").val()+"/01");
                $("#calendar").calendar({year:d.getFullYear(),month:d.getMonth()+1,selectedDays:'1,4,7'});
            });
        });
    </script>
</body>
</html>